<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>支付宝支付</title>
    <meta name="viewport" content="initial-scale=1.0, width=device-width, user-scalable=no" />
    <style type="text/css">
        /* CSS RESET */
        * { padding: 0; margin: 0; }
        body { font: 12px "微软雅黑", Arial; background: #efeff4; min-width: 320px; max-width: 640px; color: #000; }
        a { text-decoration: none; color: #666666; }
        a, img { border: none; }
        img { vertical-align: middle; }
        ul, li { list-style: none; }
        em, i { font-style: normal; }
        .clear { clear: both }
        .clear_wl:after { content: "."; height: 0; visibility: hidden; display: block; clear: both; }
        .fl { float: left }
        .fr { float: right }
        .all_w { width: 91.3%; margin: 0 auto; }
        /*基础字体属性*/
        .f10 { font-size: 10px }
        .f11 { font-size: 11px }
        .f12 { font-size: 12px }
        .f14 { font-size: 14px }
        .f13 { font-size: 13px }
        .f16 { font-size: 16px }
        .f18 { font-size: 18px }
        .f20 { font-size: 20px }
        .f22 { font-size: 22px }
        .f24 { font-size: 24px }
        .f26 { font-size: 26px }
        .f28 { font-size: 28px }
        .f32 { font-size: 32px }
        .fb { font-weight: bold }
        /********/
        .header { background: #393a3e; color: #f5f7f6; height: auto; overflow: hidden; }
        .gofh { float: left; height: 45px; display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; }
        .gofh a { padding-right: 10px; border-right: 1px solid #2e2f33; }
        .gofh a img { width: 40%; }
        .wenx_xx { text-align: center; font-size: 16px; padding: 18px 0; }
        .wenx_xx .zhifu_price { font-size: 45px; }
        .ljzf_but { border-radius: 3px; height: 45px; line-height: 45px; background: #1677ff; display: block; text-align: center; font-size: 16px; margin-top: 14px; color: #fff; }
        /*浮动层*/
        .ftc_wzsf { display:none; width: 100%; height: 100%; position: fixed; z-index: 999; top: 0; left: 0; min-width: 320px; max-width: 640px;}
        .ftc_wzsf .hbbj { width: 100%; height: 100%; position: absolute; z-index: 8; background: #000; opacity: 0.4; top: 0; left: 0; }
        .ftc_wzsf .srzfmm_box { position: absolute; z-index: 10; background: #f8f8f8; width: 88%; left: 50%; margin-left: -44%; top: 20%; }
        .qsrzfmm_bt { font-size: 16px; border-bottom: 1px solid #c9daca; overflow: hidden; }
        .qsrzfmm_bt a { display: block; width: 10%; padding: 10px 0; text-align: center; }
        .qsrzfmm_bt img.tx { width: 10%; padding: 10px 0; }
        .qsrzfmm_bt span { padding: 15px 5px; }
        .zfmmxx_shop { text-align: center; font-size: 12px; padding: 10px 0; overflow: hidden; }
        .zfmmxx_shop .mz { font-size: 14px; float: left; width: 100%; }
        .zfmmxx_shop .zhifu_price { font-size: 24px; float: left; width: 100%; }
        .ml5 { margin-left: 5px; }
        .mm_box { width: 89%; margin: 10px auto; height: 40px; overflow: hidden; border: 1px solid #bebebe; }
        .mm_box li { border-right: 1px solid #efefef; height: 40px; float: left; width: 16.3%; background: #FFF; }
        .mm_box li:last-child { border-right: none; }
        .xiaq_tb { padding: 5px 0; text-align: center; border-top: 1px solid #dadada; }
        .numb_box { position: absolute; z-index: 10; background: #f5f5f5; width: 100%; bottom: 0px; }
        .nub_ggg { border: 1px solid #dadada; overflow: hidden; border-bottom: none; }
        .nub_ggg li { width: 33.3333%; border-bottom: 1px solid #dadada; float: left; text-align: center; font-size: 22px; }
        .nub_ggg li a { display: block; color: #000; height: 50px; line-height: 50px; overflow: hidden; }
        .nub_ggg li a:active  { background: #e0e0e0;}
        .nub_ggg li a.zj_x { border-left: 1px solid #dadada; border-right: 1px solid #dadada; }
        .nub_ggg li span { display: block; color: #e0e0e0; background: #e0e0e0; height: 50px; line-height: 50px; overflow: hidden; }
        .nub_ggg li span.del img { width: 30%; }

        .fh_but{ position:absolute; right:0px; top:12px; font-size:14px; color:#20d81f;}
        .spxx_shop{ background:#FFF; margin-left:4.35%; border-top:1px solid #dfdfdd; padding:10px 0; }
        .spxx_shop td{ color:#7b7b7b; font-size:14px; padding:10px 0;}
        .mlr_pm{margin-right:4.35%;}

        .click_opacity{ width:100%; height:100%; background:#000; opacity:0.6; position:fixed; z-index:10000; top:0px;}
        .to_btn{ position:fixed; top:10px; right:10px; text-align:right; z-index:10001; font-family:"微软雅黑";}
        .to_btn span{ display:block;}
        .to_btn img{ width:20%; height:auto; display:inline-block;}
        .to_btn .span1{ font-size:1.6rem; color:#fff; margin-top:5px;}
        .to_btn{ color:#fff;}
        .to_btn .span2{ display:inline-block; line-height:36px; width:80%; margin-bottom:12px; text-align:left; font-size:16px;}
        .to_btn .span2 em{ display:inline-block; width:16px; height:16px; background:#009dd9; color:#fff; font-size:12px; text-align:center; line-height:16px; border:1px solid #fff; border-radius:50%; margin-right:3px;}
        .to_btn .span2 img{ display:inline-block; width:30px; height:30px; margin:0px 5px;}
        .to_btn span{ display:block; float:right;}
        .to_btn .android_open img{ display:inline-block; width:150px; height:34px;}
    </style>
</head>
<body>
<div style="display: none">
    {#$form_data}
</div>
<div class="wenx_xx" style="margin-top: 30px;">
    <div class="zhifu_price">￥{#$order_info.pay_amount}</div></div>
</div>
<a href="javascript:void(0);" onclick="goPay()" class="ljzf_but all_w">立即支付</a>



<div id="weixin_ios" style="display:none;">
    <div class="click_opacity"></div>
    <div class="to_btn">
        <span class="span1">
            <img src="__PUBLIC__/aimg/click_btn.png">
        </span>
        <span class="span2">
            <em>1</em> 点击右上角
            <img src="__PUBLIC__/aimg/menu.png">
            打开菜单
        </span>
        <span class="span2">
            <em>2</em> 选择
            <img src="__PUBLIC__/aimg/safari.png">
            用Safari打开下载
        </span>
    </div>
</div>
<div id="weixin_android" style="display: none;">
    <div class="click_opacity"></div>
    <div class="to_btn"><span class="span1">
            <img src="__PUBLIC__/aimg/click_btn.png">
        </span>
        <span class="span2">
            <em>1</em> 点击右上角
            <img src="__PUBLIC__/aimg/menu_android.png">
            打开菜单
        </span>
        <span class="span2 android_open">
            <em>2</em> 选择
            <img src="__PUBLIC__/aimg/android.png">
        </span>
    </div>
</div>

<script src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript">
    function goPay() {
        document.forms['alipaysubmit'].submit();
    }
    var this_order_sn = '{#$order_info.order_sn}';
    var is_html5 = {#$is_html5};



    var ua = navigator.userAgent.toLowerCase();
    var Sys = {};
    var s;
    (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;

    if (/(iPhone|iPad|iPod|iOS)/i.test(ua)) {
        if (Sys.safari) {

        }else{
            $("#weixin_ios").show();
        }
    }else{
        if(ua.indexOf(' qq')>-1 && ua.indexOf('mqqbrowser') <0){
            $("#weixin_android").show();
        }
        else if (ua.match(/MicroMessenger/i) == "micromessenger") {
            $("#weixin_android").show();
        }
        else{

        }
    }

    $(function () {
        if(is_html5 == 1){
            //checkPayStatus();
        }
    })
    function checkPayStatus() {
        $.ajax({
            type:"POST",
            data:{order_sn:this_order_sn,_:Date.now()},
            dataType:"json",
            url:"{#:U('Index/checkPayStatus')}",
            success:function(data){
                if(data.code == 1){
                    window.location.href = data.info.url;
                }else{
                    setTimeout(checkPayStatus,3000);
                }
            }
        })
    }
</script>
</body>
</html>